import request from '@/utils/request'
// 合作商点位数
export const nodeCollect = () => request.get('/api/vm-service/node/nodeCollect')

// 区域管理
export const regionSearch = data => request.get('/api/vm-service/region/search', {
  params: data
})

// 新增区域
export const addRegion = data => request.post('/api/vm-service/region', data)

// 修改区域
export const editNode = data => request.put(`/api/vm-service/region/${data.id}`, data)

// 删除区域
export const delRegion = id => request.delete(`/api/vm-service/region/${id}`)

// 点位搜索/查看区域详情
export const searchNode = data => request.get('/api/vm-service/node/search', { params: data })

// 获取商圈列表
export const businessType = () => request.get('/api/vm-service/businessType')

// 合作商搜索
export const partner = params => request.get('/api/user-service/partner/search', { params })

// 新增点位
export const addNode = data => request.post('/api/vm-service/node', data)

// 修改点位
export const updateNode = data => request({
  method: 'PUT',
  url: `/api/vm-service/node/${data.id}`,
  data
})

// 删除点位
export const delNode = params => request.delete(`/api/vm-service/node/${params.id}`, { params })

// 点位详情
export const vmList = id => request.get(`/api/vm-service/node/vmList/${id}`)

// 新增合作商
export const addPartner = data => request.post('/api/user-service/partner', data)

// 修改合作商
export const updatePartner = data => request.put(`/api/user-service/partner/${data.id}`, data)

// 删除合作商
export const delPartner = params => request.delete(`/api/user-service/partner/${params.id}`, { params })

// 重置合作商密码
export const updatePwd = id => request.put(`/api/user-service/partner/resetPwd/${id}`)
